嗨我是k66,接下來兩篇是實作,將自己的Logo顯示至terminal上。
開始前先簡介在OinkBL.c
會用到的3個名詞:
1變數(BLT)
。放碼上來!程式碼連結
Day13與Day14會寫三個C
、INF
、DSC
檔案,資料夾架構如下:
|-edk2
|-OinkBLPkg
|-OinkBLPkg.dsc
|-OinkBL.c
|-OinkBL.inf
|-MdePkg // Day6下載的
|-ModulePkg // Day6下載的
OinkBL.inf
:[Defines]
INF_VERSION = 0x00010006
BASE_NAME = OinkBL
FILE_GUID = f20c2e90-c1d4-482a-a03d-ca59897556ea
MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 0.1
ENTRY_POINT = UefiMain
[Sources]
OinkBL.c
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
UefiApplicationEntryPoint
UefiLib
BmpSupportLib
[Guids]
gEfiFileInfoGuid
OinkBLPkg.dsc
:[Defines]
PLATFORM_NAME = OinkBLPkg
PLATFORM_GUID = d6097f53-fca0-4540-a7b3-bb4008086628
PLATFORM_VERSION = 0.1
DSC_SPECIFICATION = 0x00010005
SUPPORTED_ARCHITECTURES = X64
BUILD_TARGETS = DEBUG|RELEASE
[LibraryClasses]
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
BmpSupportLib|MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf
SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
[Components]
OinkBLPkg/OinkBL.inf
OinkBL.c放至明天是因為目前有兩百多行,我再試著精簡之,明天見!
想想看為什麼UEFI在圖片上預設選擇BMP格式?而非PNG?
[自我挑戰5]是因為這樣載入時效能比較好嗎?
哈哈這題其實是我想向讀者請教的~
先回答你的答覆~個人認為PNG載入效能會比BMP差,因為後者記錄更多圖片資訊,也因此檔案較大。下圖是同一檔案小畫家輸出格式大小差異,可見BMP遠大於PNG。
回到題目,其實UEFI也支援PNG喔!
(圖截自官方https://github.com/tianocore/edk2/commit/333ba578fef4dff8921051410c5b56f63e7eeadb)
我知道的UEFI顯示圖有兩種做法,透過:HII與TranslateBmpToGopBlt。前者支援PNG及BMP,後者僅支援BMP。
現在UEFI利用HII支援PNG,這也比較符合圖檔愈小愈好的設計邏輯~我非常好奇當初UEFI設計師選擇BMP的理由,也許是當時考慮挺微軟而使用BMP?
謝謝K66大大詳細解答